;(function($){

    // 更新 coupon
    $('#update_Coupon_form').on('submit', function() {
        $('#update_Coupon_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/coupon/addtoOrUpdate',
            type: 'post',
            data: $('#update_Coupon_form').serialize(),
            success: function(data) {
                var msg_type = (data.status == 1) ? 'success' : 'error';
                $('#update_Coupon_form button[type="submit"]').removeAttr('disabled');
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#detailCoupon').modal('hide');
                    $('#coupon_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_Coupon_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 更新 productproperty
    $('#update_product_property_form').on('submit', function() {
        $('#update_product_property_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/product_property/addtoOrUpdate',
            type: 'post',
            data: $('#update_product_property_form').serialize(),
            success: function(data) {
                var msg_type = (data.status == 1) ? 'success' : 'error';
                $('#update_product_property_form button[type="submit"]').removeAttr('disabled');
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#detailProductProperty').modal('hide');
                    $('#product_property_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_product_property_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 新增 productproperty
    $('#add_product_property_form').on('submit', function() {
        $('#add_product_property_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/product_property/addOrUpdate',
            type: 'post',
            data: $('#add_product_property_form').serialize(),
            success: function(data) {
                var msg_type = (data.status == 1) ? 'success' : 'error';
                $('#add_product_property_form button[type="submit"]').removeAttr('disabled');
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addProductroperty').modal('hide');
                    $('#product_property_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_product_property_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 新增 Banner
    $('#add_banner_form').on('submit', function() {
        $('#add_banner_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/banner/addOrUpdate',
            type: 'post',
            data: $('#add_banner_form').serialize(),
            success: function(data) {
                var msg_type = (data.status == 1) ? 'success' : 'error';
                $('#add_banner_form button[type="submit"]').removeAttr('disabled');
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addBanner').modal('hide');
                    $('#banner_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_banner_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 更新 Banner
    $('#update_banner_form').on('submit', function() {
        $('#update_banner_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/banner/addOrUpdate',
            type: 'post',
            data: $('#update_banner_form').serialize(),
            success: function(data) {
                $('#update_banner_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#detailBanner').modal('hide');
                    $('#banner_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_banner_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 添加 BannerItem  轮播图
    $('#add_banner_item_form').on('submit', function() {
        $('#add_banner_item_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/banner_item/addOrUpdate',
            type: 'post',
            data: new FormData($("#add_banner_item_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#add_banner_item_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addBannerItem').modal('hide');
                    $('#banner_item_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_banner_item_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 添加 BannertoItem  详情
    $('#addto_banner_item_form').on('submit', function() {
        $('#addto_banner_item_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/product_banner/addOrUpdate',
            type: 'post',
            data: new FormData($("#addto_banner_item_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#addto_banner_item_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addtoBannerItem').modal('hide');
                    $('#banner_item_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#addto_banner_item_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 更新 BannerItem
    $('#update_banner_item_form').on('submit', function() {
        $('#update_banner_item_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/banner_item/addOrUpdate',
            type: 'post',
            data: new FormData($("#update_banner_item_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#update_banner_item_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addBannerItem').modal('hide');
                    $('#banner_item_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_banner_item_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 添加 Image
    $('#add_image_form').on('submit', function() {
        $('#add_image_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/image/addOrUpdate',
            type: 'post',
            data: new FormData($("#add_image_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#add_image_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addImage').modal('hide');
                    $('#image_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_image_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    $('#update_image_form').on('submit', function() {
        $('#update_image_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/image/addOrUpdate',
            type: 'post',
            data: new FormData($("#update_image_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#update_image_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#detailImage').modal('hide');
                    $('#image_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_image_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 添加 theme
    $('#add_theme_form').on('submit', function() {
        $('#add_theme_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/theme/addOrUpdate',
            type: 'post',
            data: new FormData($("#add_theme_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#add_theme_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addTheme').modal('hide');
                    $('#theme_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_theme_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 更新 theme
    $('#update_theme_form').on('submit', function() {
        $('#update_theme_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/theme/addOrUpdate',
            type: 'post',
            data: new FormData($("#update_theme_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#update_theme_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#detailTheme').modal('hide');
                    $('#theme_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_theme_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // addProduct
    $('#add_product_form').on('submit', function() {
        $('#add_product_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/product/addOrUpdate',
            type: 'post',
            data: new FormData($("#add_product_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#add_product_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addProduct').modal('hide');
                    $('#product_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_product_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // updateProduct
    $('#update_product_form').on('submit', function() {
        $('#update_product_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/product/addOrUpdate',
            type: 'post',
            data: new FormData($("#update_product_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#update_product_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#detailProduct').modal('hide');
                    $('#product_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_product_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // addProductImage
    $('#add_product_image_form').on('submit', function() {
        $('#add_product_image_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/product_image/addOrUpdate',
            type: 'post',
            data: new FormData($("#add_product_image_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#add_product_image_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addProductImage').modal('hide');
                    $('#product_image_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_product_image_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // updateProductImage
    $('#update_product_image_form').on('submit', function() {
        $('#update_product_image_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/product_image/addOrUpdate',
            type: 'post',
            data: new FormData($("#update_product_image_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#update_product_image_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#detailProductImage').modal('hide');
                    $('#product_image_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_product_image_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    $('#add_product_info_form').on('submit', function() {
        $('#add_product_info_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/product_info/addOrUpdate',
            type: 'post',
            data: new FormData($("#add_product_info_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#add_product_info_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addProductInfo').modal('hide');
                    $('#product_info_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_product_info_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    $('#update_product_info_form').on('submit', function() {
        $('#update_product_info_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/product_info/addOrUpdate',
            type: 'post',
            data: new FormData($("#update_product_info_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#update_product_info_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#detailProductInfo').modal('hide');
                    $('#product_info_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_product_info_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    $('#add_category_form').on('submit', function() {
        $('#add_category_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/category/addOrUpdate',
            type: 'post',
            data: new FormData($("#add_category_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#add_category_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addCategory').modal('hide');
                    $('#category_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_category_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    $('#update_category_form').on('submit', function() {
        $('#update_category_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/category/addOrUpdate',
            type: 'post',
            data: new FormData($("#update_category_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#update_category_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#detailCategory').modal('hide');
                    $('#category_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_category_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // addThemeProduct
    $('#addThemeProduct').on('submit', function() {
        $('#add_theme_product_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/theme_product/addOrUpdate',
            type: 'post',
            data: new FormData($("#add_theme_product_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#add_theme_product_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addThemeProduct').modal('hide');
                    $('#theme_product_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_theme_product_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // addCard
    $('#add_card_form').on('submit', function() {
        $('#add_card_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/bank_card/addOrUpdate',
            type: 'post',
            data: new FormData($("#add_card_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#add_card_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addCard').modal('hide');
                    $('#bank_card_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_card_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // updateCard
    $('#update_card_form').on('submit', function() {
        $('#update_card_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/bank_card/addOrUpdate',
            type: 'post',
            data: new FormData($("#update_card_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#update_card_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#detailCard').modal('hide');
                    $('#bank_card_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_card_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // addAgent
    $('#add_agent_form').on('submit', function() {
        $('#add_agent_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/agent/addOrUpdate',
            type: 'post',
            data: new FormData($("#add_agent_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#add_agent_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addAgent').modal('hide');
                    $('#agent_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_agent_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // updateAgent
    $('#update_agent_form').on('submit', function() {
        $('#update_agent_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/agent/addOrUpdate',
            type: 'post',
            data: new FormData($("#update_agent_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#update_agent_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#detailAgent').modal('hide');
                    $('#agent_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_agent_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // updateUser
    $('#update_user_form').on('submit', function() {
        $('#update_user_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/user/update',
            type: 'post',
            data: new FormData($("#update_user_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#update_user_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#detailUser').modal('hide');
                    $('#user_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_user_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 添加 message
    $('#add_message_form').on('submit', function() {
        $('#add_message_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/message/addOrUpdate',
            type: 'post',
            data: new FormData($("#add_message_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#add_message_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addMessage').modal('hide');
                    $('#message_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_message_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 更新Message
    $('#update_message_form').on('submit', function() {
        $('#update_message_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/message/addOrUpdate',
            type: 'post',
            data: new FormData($("#update_message_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#update_message_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#updateMessage').modal('hide');
                    $('#message_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_message_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 添加 notice
    $('#add_notice_form').on('submit', function() {
        $('#add_notice_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/notice/addOrUpdate',
            type: 'post',
            data: new FormData($("#add_notice_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#add_notice_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addNotice').modal('hide');
                    $('#notice_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_notice_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 更新 notice
    $('#update_notice_form').on('submit', function() {
        $('#update_notice_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/notice/addOrUpdate',
            type: 'post',
            data: new FormData($("#update_notice_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#update_notice_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#updateNotice').modal('hide');
                    $('#notice_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#update_notice_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 添加 order
    $('#add_order_form').on('submit', function() {
        $('#add_order_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/order/addOrUpdate',
            type: 'post',
            data: new FormData($("#add_order_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#add_order_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#addOrder').modal('hide');
                    $('#order_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#add_order_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 确认发货
    $('#deliver_goods_form').on('submit', function() {
        $('#deliver_goods_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/order/confirm_goods',
            type: 'post',
            data: new FormData($("#deliver_goods_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#deliver_goods_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#deliver_goods').modal('hide');
                    $('#order_two_list').bootstrapTable('refresh');
                    $('#order_three_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#deliver_goods_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

    // 确认收货
    $('#collect_goods_form').on('submit', function() {
        $('#collect_goods_form button[type="submit"]').attr('disabled', 'disabled');
        $.ajax({
            url: '/order/collectGoods',
            type: 'post',
            data: new FormData($("#collect_goods_form").get(0)),
            cache: false,
            processData: false,
            contentType: false,
            success: function(data) {
                $('#collect_goods_form button[type="submit"]').removeAttr('disabled');
                var msg_type = (data.status == 1) ? 'success' : 'error';
                showMsg(data.message, msg_type);
                if (data.status == 1) {
                    $('#collect_goods').modal('hide');
                    $('#order_three_list').bootstrapTable('refresh');
                    // $('#order_three_list').bootstrapTable('refresh');
                }
            },
            error: function (e) {
                $('#collect_goods_form button[type="submit"]').removeAttr('disabled');
                showError(e);
            }
        });
        return false;
    });

})(jQuery);

